<template>
  <a-modal
    :visible.sync="showSdDetail"
    @cancel="closeSdDetail"
    title="详情"
    cancelText="关闭"
    :width="modalWidth"
    destroyOnClose
    :confirmLoading="confirmLoading"
    :bodyStyle="tstyle">
    <template slot="footer">
      <a-button key="取消" @click="closeSdDetail">关闭</a-button>
    </template>
    <a-card :title='"供应商工单编号："+ supplierWorkNo' :bordered="true">
      <a-row :span="24">
        <a-col :span="8">
          物资品类类型：{{ dataSourceDetail.categoryType }}
        </a-col>
        <a-col :span="8">
          供应商工单编号：{{ dataSourceDetail.supplierWorkNo }}
        </a-col>
        <a-col :span="8">
          国网侧供应商编码：{{ dataSourceDetail.supplierCode }}
        </a-col>
      </a-row>
      <a-row :span="24" style="margin-top: 10px;">
        <a-col :span="8">
          供应商数据编号：{{ dataSourceDetail.supplierSupportId }}
        </a-col>
        <a-col :span="8">
          厂区编号：{{ dataSourceDetail.factoryCode }}
        </a-col>
        <a-col :span="8">
          供应商产品厂内编码：{{ dataSourceDetail.productModel }}
        </a-col>
      </a-row>
      <a-row :span="24" style="margin-top: 10px;">
        <a-col :span="8">
          生产设备名称：{{ dataSourceDetail.equipmentName }}
        </a-col>
        <a-col :span="8">
          生产设备唯一识别号：{{ dataSourceDetail.equipmentUniqueCode }}
        </a-col>
        <a-col :span="8">
          湿度：{{ dataSourceDetail.humidity }}
        </a-col>
      </a-row>
      <a-row :span="24" style="margin-top: 10px;">
        <a-col :span="8">
          采集时间：{{ dataSourceDetail.checkTime }}
        </a-col>
        <a-col :span="8">
          工序：{{ dataSourceDetail.pdCode }}
        </a-col>
      </a-row>
    </a-card>
  </a-modal>
</template>
<script>
  export default {
    name: 'SdDetail',
    props: {
      dataSourceDetail: {
        type: Object,
        default: false
      }
    }, data() {
      //详细信息表头
      return {
        showSdDetail: true,                     //详情页面
        supplierWorkNo: '',
        modalWidth: '70%',
        tstyle: {
          'height': '450px',
          'overflow': 'auto'
        },
        loading: false,
        confirmLoading: false
      }
    }
    ,
    methods: {
      closeSdDetail() {//详细信息是否关闭
        this.$emit('close')
      },
      loadData() {
        let sd = this.dataSourceDetail
        this.supplierWorkNo = sd.supplierWorkNo
      }
    }, created() {
      this.loadData()
    }
  }
</script>
